// 接口:https://service-ase3oocp-1302839645.sh.apigw.tencentcs.com/api/room/room/getRoomList?pageNo=1&pageSize=3

import IndexedDB from '../utils/indexedDB'
const airbnbDB = new IndexedDB('airbnb');
// 真实接口

// Mock接口 
export async function fetchElephantAll(storeName: string) {
    await airbnbDB.openStore(storeName)
    const result = await airbnbDB.getAllList(storeName).then(res => {
        return {
            code: '000000',
            message: '操作成功',
            result: res,
            success: true
        }
    })
    return result
}

export async function fetchElephantItem(storeName: string, id: number | string) {
    await airbnbDB.openStore(storeName)
    const result = await airbnbDB.getItem(storeName, id).then(res => {
        return {
            code: '00000',
            message: '操作成功',
            result: res,
            success: true
        }
    })
    return result
}